#!/usr/bin/env bash

set -e

app=$1
port=${2:-8080}

root="$(git rev-parse --show-toplevel)"
. "$root/scripts/cd-and-back.sh"
cd "$root/e2e"

bun run start-test "CY_TEST=true bundle exec $root/gem/bin/pagy $app -p $port" "http://0.0.0.0:$port" "cypress open"
